﻿@{
    if(Request.IsAuthenticated){

        GPI.Models.Person p;
        GPI.Models.Entities db = GPI.Models.Entities.GetEntitiesForUser(User);
        if (User.IsInRole("Admin"))
        {
            p = db.GPI_ADMIN.Find(User.Identity.Name);
        }
        else if (User.IsInRole("Prof"))
        {
            p = db.GPI_PROF.Find(User.Identity.Name);
        }
        else
        {
            p = db.GPI_STUDENT.Find(User.Identity.Name);
        }
        <text>Bienvenue <strong>@p.GetFirstName() @p.GetLastName()</strong>!
        [ @Html.ActionLink("Déconnexion", "LogOff", "Account") ]</text>
    }
    else {
        @:[ @Html.ActionLink("Connexion", "LogOn", "Account") ]
    }
}